
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;

public class Sobre extends Canvas {

    private int menux = 0;
    private int menuy = 0;
    private int menuw = getWidth();
    private int menuh;

    public Sobre() {
        setFullScreenMode(true);
        menuh = getHeight();
    }

    public void keyPressed(int kc) {
        DMath.getInstance().getDisplay().setCurrent(new Menu());
    }

    protected void pointerPressed(int x, int y) {
        DMath.getInstance().getDisplay().setCurrent(new Menu());
    }

    protected void paint(Graphics g) {
        g.fillRect(0, 0, getWidth(), getHeight());

        String titulo = "Sobre";
        int h = g.getFont().getHeight();
        int w = g.getFont().stringWidth(titulo);

        Game.drawBevelRect(g, 0, menuy, menuw, menuh, 0x222222, 0x444444,
                0x666666);

        Game.drawBevelRect(g, menux + 4, menuy + h + 1, menuw - 8, menuh
                - (4 + h + 1), 0x666666, 0x000000, 0x222222);

        g.setColor(0x00ff50);
        g.drawString(titulo, (getWidth() - w) / 2, 1, 0);

        int kx = menux + 6;
        int ky = menuy + h + 2;

        Font smf = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN,
                Font.SIZE_SMALL);
        g.setFont(smf);

        g.setColor(0x00ff50);
        g.drawString("DMath:", kx, ky, 0);

        g.drawString("Feito por:", kx, ky + smf.getHeight(), 0);
        g.drawString("Antonio Diego", kx, ky + (smf.getHeight() * 2), 0);
        g.drawString("antoniodiegoluz@hotmail.com", kx, ky + (smf.getHeight() * 3), 0);
//      g.drawString("Acessem:", kx, ky + (smf.getHeight() * 4), 0);
//      g.drawString("pedrotiago.wapka.mobi", kx, ky + (smf.getHeight() * 5), 0);
//      g.drawString("Youtube e Twitter:", kx, ky + (smf.getHeight() * 6), 0);
//      g.drawString("TheAntonioDiego", kx, ky + (smf.getHeight() * 7), 0);
//      g.drawString(">>DDTA Videos<<", kx, ky + (smf.getHeight() * 8), 0);
//      g.drawString("  Aperte Qualquer Tecla", kx, ky + (smf.getHeight() * 9), 0);
        g.drawString("  Aperte qualquer tecla", kx, ky + (smf.getHeight() * 4), 0);
    }
}
